<template>
  <el-select v-model="val" ref="elSelect">
    <el-option
      v-for="(item, index) in options"
      :key="index"
      :label="item.label"
      :value="item.value"
    ></el-option>
  </el-select>
</template>
<script>
export default {
  props: {
    modelValue: {
      type: String,
    },
  },
  data() {
    return {
      val: this.modelValue,
      options: [],
    };
  },
  watch: {
    val() {
      this.$emit("input", this.val);
    },
  },
  created() {
    this.options = Array(10)
      .fill(1)
      .map((item, index) => ({
        label: "label" + (index + 1),
        value: "value" + (index + 1),
      }));
  },

  methods: {},
};
</script>
<style lang="scss" scoped></style>
